// add a namespace
var App =new Em.Application();

// Example 1
App.president = E.Object.create({
    firstName: "Barack",
    lastName: "Obama",
    name: "奥巴马先生" ,
    fullName: function() {
        return this.get('firstName') + ' ' + this.get('lastName');
        // Tell E that this computed property depends on firstName
        // and lastName
    }.property('firstName', 'lastName')
});

$('#btn1').click( function() {
    App.president.set('lastName', '奥巴马');
});


// Example 2
App.InfoView = E1.View.extend({
    tEplateName: 'info',
    posts: 25,
    hobbies: "Riding bicycles"
});
App.InfoView.create().appendTo('#tEp-wrap');

// or
// var info = App.InfoView.create();
// info.appendTo('#tEp-wrap');


// Example 3
App.country = E.Object.create({
    // Ending a property with 'Binding' tells E to
    // create a binding to the presidentName property.
    presidentNameBinding: 'App.president.name'
});
// Later, after E has resolved bindings...
$('#btn2').click( function() {
    alert(App.country.get('presidentName'));  // "Barack Obama"
});


// Example 4
App.ClickableView = E.View.extend({
    click: function(evt) {
        alert("ClickableView was clicked!");
    }
});

// Example 5
App.ListingView = E.View.extend({
    tEplateName: 'edit',
    edit: function(event) {
        alert('Edited')
    }
});












